package br.com.buildup.cripto;

public class CryptographyBuilder {
    public static Cryptography build(CryptographyType type) {
        if (type != null) {
            switch (type) {
            case MD5: return new CryptographyMD5();
            case SHA_256: return new CryptographySHA256();
            case SHA_512: return new CryptographySHA512();
            case TRIPLE_DES:
                try {
                    return CryptographyTripeDES.newInstance();
                } catch (Exception e) {
                    return null;
                }
            }
        }

        return null;
    }
}
